<%@ page import="com.xdwanj.util.UrlUtil" %>
<%@ page import="com.xdwanj.servlet.UserServlet" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/jsp/common/head.jsp" %>

<div class="container">
    <form class="form-horizontal" method="post" action="${pageContext.request.contextPath}<%=UrlUtil.getUrl(UserServlet.REQUEST_MAPPING,
    new String[]{UserServlet.METHOD, UserServlet.ADD_PET})%>" style="padding: 20vh;">

        <span style="color: red">${status}</span>
        <div class="form-group" id="mh-pet-name">
            <label class="col-sm-2 control-label">宠物名</label>
            <div class="col-sm-10">
                <input type="text" name="petName" class="form-control" placeholder="名字">
            </div>
        </div>

        <div class="form-group" id="mh-pet-age">
            <label class="col-sm-2 control-label">年龄</label>
            <div class="col-sm-10">
                <input type="text" name="petAge" class="form-control" placeholder="年龄(月)"
                       onkeyup="this.value=this.value.replace(/\D/g,'')"
                       onafterpaste="this.value=this.value.replace(/\D/g,'')">
            </div>
        </div>

        <div class="form-group" id="mh-pet-type">
            <label class="col-sm-2 control-label">品种</label>
            <div class="col-sm-10">
                <input type="text" name="petType" class="form-control" placeholder="品种">
            </div>
        </div>

        <div class="form-group" id="mh-pet-weight">
            <label class="col-sm-2 control-label">体重</label>
            <div class="col-sm-10">
                <input type="text" name="petWeight" class="form-control" placeholder="体重"
                       onkeyup="this.value=this.value.replace(/\D/g,'')"
                       onafterpaste="this.value=this.value.replace(/\D/g,'')">
            </div>
        </div>

        <div class="form-group">
            <div class="radio">
                <label class="col-sm-2 control-label"></label>
                <label>
                    <input type="radio" name="petSex" value="1" checked="">
                    雄性
                </label>
                &nbsp;
                &nbsp;
                &nbsp;
                <label>
                    <input type="radio" name="petSex" value="2" checked="">
                    雌性
                </label>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary" id="submit">确认添加</button>
            </div>
        </div>

    </form>
</div>

<%@include file="/jsp/common/foot.jsp" %>
<script charset="UTF-8" src="${pageContext.request.contextPath}/js/addpet.js"></script>
